<template>
	<view class="page" :style="themeColor">
		<view class="flex benben-position-layout flex flex-wrap align-center logOutReason_flex_0"
			:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
			<view class='flex flex-wrap align-center justify-between flex-sub logOutReason_fd0_0'>
				<view class='flex flex-wrap align-center' @tap.stop="handleJumpDiy" data-type="back" data-url="1">
					<text class='fu-iconfont2  logOutReason_fd0_0_c0_c0' @tap.stop="handleJumpDiy" data-type="back"
						data-url="1">&#xE794;</text>
				</view>
				<view class='flex flex-wrap align-stretch justify-center flex-sub'>
					<text class='logOutReason_fd0_0_c1_c0'>注销账号</text>
				</view>
				<view class='flex flex-wrap align-center logOutReason_fd0_0_c2'>
				</view>
			</view>

		</view>
		<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
		
		<view class="loading_css" v-if="isShow">
			<u-loading size="36" color="#cd962d"></u-loading>
			<view class="loading_text">加载中</view>
		</view>

		<view class="flex flex-direction flex-wrap align-stretch logOutReason_flex_1" v-else>
			<view class='flex flex-wrap align-center logOutReason_fd1_0'>
				<text class='logOutReason_fd1_0_c0'>账号注销</text>
			</view>
			<text class='logOutReason_fd1_1'>永久注销且无法恢复，请谨慎操作</text>
			<view class='flex flex-wrap align-center logOutReason_fd1_2'>
				<text class='logOutReason_fd1_2_c0'>请选择注销账号的原因：</text>
			</view>
			<view class='flex flex-direction flex-wrap align-stretch'>
				<benben-select-diy ref="showSelectPopup1687329118735"
					class-name='flex flex-direction align-stretch flex' :items.sync="dataList" v-model="cancel_type"
					default-type="aid" default-label="name" :allow-cancel='false' type="radio" :disabled='false'>
					<template v-for='(item,key0) in dataList'>
						<view v-if="item.isSelected" class='flex align-center flex logOutReason_fd1_3_c0_c0' :key="key0"
							@tap="$refs.showSelectPopup1687329118735.tapHandle(key0)">
							<image class='logOutReason_fd1_3_c0_c0_c0' mode="aspectFit" :src='STATIC_URL+"70.png"'>
							</image>
							<text class='logOutReason_fd1_3_c0_c0_c1'>{{item.name}}</text>
						</view>
						<view v-else class='flex align-center flex logOutReason_fd1_3_c0_c0' :key="key0"
							@tap="$refs.showSelectPopup1687329118735.tapHandle(key0)">
							<image class='logOutReason_fd1_3_c0_c0_c0' mode="aspectFit" :src='STATIC_URL+"85.png"'>
							</image>
							<text class='logOutReason_fd1_3_c0_c0_c1'>{{item.name}}</text>
						</view>
					</template></benben-select-diy>
			</view>
			<text class='logOutReason_fd1_4'>请填写注销原因</text>
			<view class='flex flex-wrap logOutReason_fd1_5'>
				<textarea class='flex logOutReason_input_fd1_5' confirm-type="done" :placeholder="'请输入注销原因'"
					:maxlength="100" placeholder-style="color:#999;font-size:28rpx" v-model="cancel_reason" />

			</view>
			<button class='logOutReason_fd1_6' @tap.stop="goToPageFunc()">下一步</button>
		</view>




	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'
	export default {
		components: {},


		data() {
			return {
				"dataList": [],
				"cancel_type": "",
				"cancel_reason": "",
				"isShow": true
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			this.getDataListFunc()
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//获取注销原因
			async getDataListFunc() {
				//请求方法
				//数据验证

				let datadataList = await this.$api.post(global.apiUrls.post637c458b131e3, {

				});
				this.isShow = false;
				if (datadataList.data.code != 1) {
					this.$message.info(datadataList.data.msg);
					return
				}
				let infodataList = datadataList.data;
				this.dataList = infodataList.data;
				if (this.dataList.length > 0) {
					this.cancel_type = this.dataList[0].aid;
				}
			},
			//下一页
			goToPageFunc() {
				if (!validate(this.cancel_type, 'require')) {
					this.$message.info('请选择注销原因');
					return false;
				}
				uni.redirectTo({
					url: `/pages/xtsz/logOutRisk/logOutRisk?cancel_type=${this.cancel_type}&cancel_reason=${this.cancel_reason}`
				})
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: var(--benbenbgColor1);
		background-size: 100% auto !important;
	}

	.logOutReason_flex_0 {
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.logOutReason_fd0_0_c2 {
		width: 32rpx;
		height: 32rpx;
	}

	.logOutReason_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333;
		line-height: 88rpx;
	}

	.logOutReason_fd0_0_c0_c0 {
		font-size: 32rpx;
		font-weight: 500;
		color: #333;
		line-height: 88rpx;
	}

	.logOutReason_fd0_0 {
		margin: 0rpx 32rpx 0rpx 32rpx;
	}

	.logOutReason_flex_1 {
		background: #fff;
		font-size: 32rpx;
		background-size: 100% auto !important;
		padding: 0rpx 32rpx 60rpx 32rpx;
	}

	.logOutReason_fd1_6 {
		background: rgba(205, 150, 45, 1);
		border-radius: 44rpx 44rpx 44rpx 44rpx;
		font-size: 32rpx;
		color: #fff;
		height: 88rpx;
		line-height: 88rpx;
		position: fixed;
		bottom: calc(44rpx + var(--window-bottom));
		width: 686rpx;
	}

	.logOutReason_input_fd1_5 {
		width: 100%;
		height: 80rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: #333;
	}

	.logOutReason_fd1_5 {
		border-bottom: 1px solid rgba(237, 237, 237, 1);
		background: rgba(245, 245, 248, 1);
		width: 686rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		padding: 24rpx 24rpx 24rpx 24rpx;
		margin: 24rpx 0rpx 0rpx 0rpx;
	}

	.logOutReason_fd1_4 {
		border-top: 1px solid #eee;
		line-height: 33rpx;
		font-size: 24rpx;
		font-weight: 400;
		color: #FF3A3A;
		padding: 58rpx 0rpx 24rpx 0rpx;
		margin: 32rpx 0rpx 0rpx 0rpx;
	}

	.logOutReason_fd1_3_c0_c0_c1 {
		line-height: 40rpx;
		font-size: 28rpx;
		font-weight: 500;
		color: #333333;
	}

	.logOutReason_fd1_3_c0_c0_c0 {
		width: 36rpx;
		height: 36rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		margin: 0rpx 20rpx 0rpx 0rpx;
	}

	.logOutReason_fd1_3_c0_c0 {
		padding: 20rpx 0rpx 20rpx 0rpx;
	}

	.logOutReason_fd1_2_c0 {
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 700;
		color: #333333;
	}

	.logOutReason_fd1_2 {
		border-top: 1px solid rgba(237, 237, 237, 1);
		padding: 32rpx 0rpx 12rpx 0rpx;
		margin: 32rpx 0rpx 0rpx 0rpx;
	}

	.logOutReason_fd1_1 {
		line-height: 40rpx;
		font-size: 28rpx;
		font-weight: 500;
		color: rgba(102, 102, 102, 1);
	}

	.logOutReason_fd1_0_c0 {
		line-height: 48rpx;
		font-size: 32rpx;
		font-weight: 500;
		color: #333333;
	}

	.logOutReason_fd1_0 {
		padding: 32rpx 0rpx 32rpx 0rpx;
	}
</style>